<?php

Class Messenger {

	function Service($action) {
		if(method_exists($this, '_action_' . $action)) {
			$result = call_user_func_array(array($this, '_action_' . $action), array());
			//$result = $this->{$action};
			if($result) {
				return array('type' => 'array', 'data' => $result);
			}
		}
	}

	function _action_get_contact_list() {

		print json_encode(
						array(
							'result' => 'ok', 
							'data' => array(
									'1' => array(
												'id' => '1',
												'name' => 'admin',
												'login' => 'admin',
												'pass' => '12345',
												'status' => false
											),
									'2' => array(
												'id' => '2',
												'name' => 'user',
												'login' => 'user',
												'pass' => '12345',
												'status' => true
											)
									)
							)
						);
		exit();
	}

	function _action_add_user_contact_list()
	{

		

	}

	function _action_remove_user_contact_list()
	{



	}

	function _action_send_messege()
	{



	}

	function _action_show_all_contacts()
	{



	}

	function _action_show_last_contacts()
	{



	}

	function _action_get_list_contact_online()
	{



	}

	function _action_check_new_message()
	{



	}

	function _action_show_last_message()
	{



	}
	
	function _action_show_all_message()
	{



	}

	function _action_search_contact()
	{



	}

}

?>